﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Separation.Entity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Separation.WebApi.Paramas;

namespace Separation.WebApi.Controllers
{

    /// <summary>
    /// 测试控制器
    /// </summary>
    [ApiController]
    [Route("api/[controller]")]
    [Authorize(Policy = nameof(AuthorizationIdentity.Users))]
    public class TestController : ControllerBase
    {
        /// <summary>
        /// 获取测试数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult TestGet()
        {
            return Ok(new TestModel
            {
                Name = "给爷爬",
                Info = "好吗?"
            });
        }
        [HttpPost]
        public IActionResult TestPost(TestModel model)
        {
            return Ok(new TestModel
            {
                Name = "给爷爬",
                Info = "好吗?"
            });
        }
        [HttpPut]
        public IActionResult TestPut()
        {
            return Ok(new
            {
                Name = "给爷爬",
                Info = "好吗?"
            });
        }
        [HttpDelete]
        public IActionResult TestDelete()
        {
            return Ok(new
            {
                Name = "给爷爬",
                Info = "好吗?"
            });
        }

    }
}
